import ajax from '../untils/request.js'

// 获取频道信息
export const getChannels = () => {
  return ajax({
    url: '/app/v1_0/user/channels',
    method: 'GET'
  })
}

// 获取全部频道信息
export const getAllChannels = () => {
  return ajax({
    url: '/app/v1_0/channels',
    method: 'GET'
  })
}

// 新增频道信息
export const addChannels = (channelsObj) => {
  return ajax({
    url: '/app/v1_0/user/channels',
    method: 'PUT',
    data: {
      channels: channelsObj
    }
  })
}

// 删除用户指定频道
export const delChannel = (channelID) => {
  return ajax({
    url: '/app/v1_0/user/channels/' + channelID,
    method: 'DELETE'
  })
}
